import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import HomeChildren from './home/index';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: () => import(/* webpackChunkName: "login" */ '../views/Home/Index.vue'),
    children: HomeChildren,
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "login" */ '../views/Login/Index.vue'),
  },
  {
    name: 'NotFound',
    path: '/:catchAll(.*)',
    component: () => import(/* webpackChunkName: "error" */ '@/views/NotFound/Index.vue'),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
